/**
 * Created by Administrator on 2017/4/21.
 */
let gameData = require('./gameData.js');
let variable = require('../data/variable.js');
let file = require('./file.js');
require('./prototype.js');

let log = module.exports;

log.data = function () {
    let args = [];
    args.push(new Date().Format("yyyy-MM-dd hh:mm:ss") + '\t');
    return args.concat([].slice.call(arguments, 0));
};
log.p = function () {
    console.log.apply(this, log.data.apply(this, arguments));
};
log.d = function () {
    if (!gameData.d.config.isDebug) {
        return false;
    }
    console.log.apply(this, log.data.apply(this, arguments));
};
log.push = function () {
    if (!gameData.d.config.pushLog) {
        return false;
    }
    console.log.apply(this, log.data.apply(this, arguments));
};
log.gate = function () {
    if (!gameData.d.config.gateLog) {
        return false;
    }
    console.log.apply(this, log.data.apply(this, arguments));
};
log.e = function () {
    console.error.apply(this, log.data.apply(this, arguments));
};
log.game = function (gameId, data) {
    return false;
    file.append(variable.path.room + '.' + gameId + '.log', JSON.stringify(data) + "\n");
};